package com.ask.socket;

import java.io.IOException;
import java.net.ServerSocket;

public class mainSocket {

    ServerSocket serverSocket = null;
    boolean listening = true;
    private int PORT = 0;

    public mainSocket() {
    }

    public mainSocket(int port) {

        try {
            serverSocket = new ServerSocket(port);

            while (this.listening) {
                listenSocket listenSocket = new listenSocket(serverSocket.accept());
            }
        } catch (IOException e) {
        }
    }

    public static void main(String[] args) throws IOException {
        mainSocket mainSocket = new mainSocket(4444);
    }

    public void setMain() {
        try {
            serverSocket = new ServerSocket(4444);

            while (this.listening) {
                listenSocket listenSocket = new listenSocket(serverSocket.accept());
            }
        } catch (IOException e) {
        }
    }

    public int getPORT() {
        return PORT;
    }

    public void setPORT(int pORT) {
        PORT = pORT;
    }
}
